var app = getApp();

function  islogin(){
  var user = wx.getStorageSync('user');
  if (user.denglu!==1){
    wx.showModal({
      title: '提示',
      content: '你还没有登录，是否确定注册登录?',
      success: function (res) {
        if (res.confirm) {
          wx.navigateTo({
            url: '/pages/login/login',
          })
        } else {
          wx.switchTab({
            url: '/pages/index/index',
          })
        }
      }
    })
  }
}
module.exports = {
  islogin: islogin
}